<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <style>
            .ui-widget,.ui-widget .ui-widget {
                font-size: 90% !important;
            }
        </style>
        <title>Receipt List</title>
    </h:head>
    <h:body>

        <ui:include src="../topmenu.xhtml"/>
<!--
        <p:panel id="pnl" header="Receipts" toggleable="false"  closable="false" toggleSpeed="500" widgetVar="panel">  
-->
            <div align="center"> 
                <p:ajaxStatus style="width:64px;height:64px;position:fixed;right:5px;bottom:5px">  
                    <f:facet name="start">  
                        <p:graphicImage value="../images/loading.gif" />  
                    </f:facet>  

                    <f:facet name="complete">  
                        <h:outputText value="" />  
                    </f:facet>  
                </p:ajaxStatus> 

                <h:form id="form">
                    <p:dataTable id="customerTableId"  var="receipt" value="#{receiptBackBean.receiptList}" style="width: 300px"> 
                        <p:column headerText="Number">
                            <h:outputText value="#{receipt.number}"/>
                        </p:column>

                        <p:column headerText="Shipper">
                            <h:outputText value="#{receipt.shipper.firstName}"/>
                        </p:column>
                        <p:column headerText="Consignee">
                            <h:outputText value="#{receipt.consignee.firstName}"/>
                        </p:column>

                        <p:column headerText="Dt Insert" style="white-space: nowrap">  
                            <h:outputText value="#{receipt.createDt}" >
                                <f:convertDateTime pattern="MM/dd/yyyy HH:mm" />
                            </h:outputText> 
                        </p:column>
                        <p:column headerText="Dt Update" style="white-space: nowrap">  
                            <h:outputText value="#{receipt.updateDt}" >
                                <f:convertDateTime pattern="MM/dd/yyyy HH:mm" />
                            </h:outputText>
                        </p:column>
                        <p:column style="width:4%">
                            <p:commandButton id="editButton" update=":frmDialog:display2" oncomplete="newReceiptcarDialog2.show();" icon="ui-icon-pencil" title="Edit">
                                <f:setPropertyActionListener value="#{receipt}" target="#{receiptBackBean.selectedReceipt}" />  
                            </p:commandButton>
                        </p:column>

                    </p:dataTable>

                    <p:commandButton id="addButton" value="Add Receipt" update=":frmDialog:display2" actionListener="#{receiptBackBean.addReceipt}" oncomplete="newReceiptcarDialog2.show();" icon="ui-icon-plusthick" title="Add"/>
                </h:form>

                <ui:include src="editReceiptDialog.xhtml"/>

                <ui:include src="receiptDetailDialog.xhtml"/>

                <ui:include src="newReceiptDialog.xhtml"/>

            </div> 
<!--
        </p:panel>
-->
    </h:body>
</html>